package com.example.hao.intentservice;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);


    }

    int i = 0;
    @Override
    public void onBackPressed() {
        Intent intent = new Intent(this, MyIntentService.class);
        intent.putExtra("abc",i++);
        startService(intent);
    }



}
